package com.life.ai.server.modules.develop.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 日志表
 * </p>
 *
 * @author kyle
 * @since 2024-06-14
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_log")
@ApiModel(value = "SysLog对象", description = "日志表")
public class SysLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty("日志标题")
    @TableField("title")
    private String title;

    @ApiModelProperty("操作IP地址")
    @TableField("remote_addr")
    private String remoteAddr;

    @ApiModelProperty("用户代理")
    @TableField("user_agent")
    private String userAgent;

    @ApiModelProperty("请求URI")
    @TableField("request_uri")
    private String requestUri;

    @ApiModelProperty("操作方式")
    @TableField("request_method")
    private String requestMethod;

    @ApiModelProperty("类名称")
    @TableField("class_name")
    private String className;

    @ApiModelProperty("方法名称")
    @TableField("method_name")
    private String methodName;

    @ApiModelProperty("请求参数")
    @TableField("params")
    private String params;

    @ApiModelProperty("返回内容")
    @TableField("results")
    private String results;

    @ApiModelProperty("操作时间")
    @TableField("operate_time")
    private Date operateTime;

    @ApiModelProperty("执行时间")
    @TableField("execute_time")
    private Long executeTime;

    @ApiModelProperty("是否异常（0正常 1异常）")
    @TableField("has_error")
    private Boolean hasError;

    @ApiModelProperty("异常信息")
    @TableField("exception")
    private String exception;

    @ApiModelProperty("删除标志（0正常 1删除）")
    @TableField("is_deleted")
    @TableLogic
    private Boolean isDeleted;

    @ApiModelProperty("创建人")
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private Long createBy;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;
}
